<?php

App::uses('AppModel', 'Model');

/**
 * Mailing Model
 *
 * @property User $User
 */
class Mailing extends AppModel {

    /**
     * Display field
     *
     * @var string
     */
    public $displayField = 'email';

    /**
     * Validation rules
     *
     * @var array
     */
    public $validate = array(
        'email' => array(
            'rule' => array('email'),
            'message' => 'Wpisz prawidłowy adres email',
            'allowEmpty' => false,
//            'required' => true,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
        )
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed

    /**
     * belongsTo associations
     *
     * @var array
     */
    public $belongsTo = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
    );

}
